<?php
namespace Plugin\Attractions\Inspection\Schema\Inspection_exception_result;

use Plugin\Attractions\Inspection\Model\Inspection_exception_result\InspectionExceptionResult;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 临时巡检结果详细信息
 */
#[Schema(title: 'InspectionExceptionResultSchema')]
class InspectionExceptionResultSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'inspection_record_id', title: '记录ID', type: 'bigint')]
    public string $inspection_record_id;

    #[Property(property: 'device_id', title: '设备ID', type: 'bigint')]
    public string $device_id;

    #[Property(property: 'photo', title: '图片', type: 'varchar')]
    public string $photo;

    #[Property(property: 'remark', title: '备注', type: 'text')]
    public string $remark;

    #[Property(property: 'status', title: '状态1：正常2：异常', type: 'tinyint')]
    public string $status;

    #[Property(property: 'created_at', title: 'created_at', type: 'datetime')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'datetime')]
    public string $updated_at;




    public function __construct(InspectionExceptionResult $model)
    {
       $this->id = $model->id;
       $this->inspection_record_id = $model->inspection_record_id;
       $this->device_id = $model->device_id;
       $this->photo = $model->photo;
       $this->remark = $model->remark;
       $this->status = $model->status;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'inspection_record_id' => $this->inspection_record_id ,'device_id' => $this->device_id ,'photo' => $this->photo ,'remark' => $this->remark ,'status' => $this->status ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}